﻿namespace EquipmentAlarmSystem.Authentication;

/// <summary>
/// 用户信息
/// </summary>
public static class Users
{
    public static List<User> UserList = new List<User>
    {
        new User { Username = "admin", Password = "123456", Role = "Admin" },
        new User { Username = "user", Password = "123456", Role = "User" }
    };

    /// <summary>
    /// 账号 密码 验证
    /// </summary>
    /// <param name="username"></param>
    /// <param name="password"></param>
    /// <returns></returns>
    public static User Authenticate(string username, string password)
    {
        return UserList.FirstOrDefault(x => x.Username == username && x.Password == password);
    }
}